
</style>
<?php
require_once '../model/works.php';
require_once '../model/db.php';
require_once '../model/keyword.php';

?>
<html>
    <head>

        <title> DO  THI QUYEN </title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <link rel="stylesheet" type="text/css" href="../css/style.css">
    </head>
    <body>

        <div class="chung">
            <div class="header"><div class="h2"><img src="images/logo.jpg" hight="180px" width="210px"/></div><div class="h1"><img src="images/Untitled-2.jpg" width="740px" hight="560px" /></div></div>
            <div class="menu">
                <ul class="nav">
                    <li><a href="#">HOME</a></li>
                    <li><a href="#">CONTENT TYPES</a>
                        <ul>
                            <li><a href="#">Companies</a></li>
                            <li><a href="#">Works</a></li>
                        </ul>
                    </li>
                    <li><a href="#">FORUMS</a></li>
                    <li><a href="#">CONTACT</a></li>
                </ul>
                <div class="search">
                    <form class="searchform" action="" method="get">
                        <input class="s" onfocus="if (this.value == 'Search…') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search…';}" type="text" name="s"  />
                        <input class="searchsubmit" type="submit" value="Search" />
                    </form>
                </div>

            </div>
            <div class="content">
                <div class="left">
                    <div class="logo">
                      <img src="images/logo.png"/>  
                        
                    </div>
                    <div class="ndleft">
                        <div class="chu"><p>MAIN MENU</p></div>
                    
                <ul>
                    <li><a href="#">HOME<img src="./images/arrow_orange.gif" /></a></li>
                    <li><a href="#">CONTENT TYPES<img src="images/arrow_orange.gif" /></a></li>
                    <li><a href="#">FORUMS<img src="images/arrow_orange.gif" /></a></li>
                    <li><a href="#">CONTACT<img src="images/arrow_orange.gif" /></a></li>
                </ul>
                    
                    </div>
                    <p>USER LOGIN</p>
                    <div class="login">
                        
                        <form method="post" action="index.html">
                            <p><input type="text" name="login" value="" placeholder="Username or Email" size="20"></p>
                            <p><input type="password" name="password" value="" placeholder="Password" size="20"></p>
                            <p class="remember_me">
                                <label>
                                    <input type="checkbox" name="remember_me" id="remember_me">
                                    Remember me on this computer
                                </label>
                            </p>
                            <p class="submit"><input type="submit" name="commit" value="Login"></p>
                        </form>
                    </div>


                </div>
                <div class="center">
                    
<?php
require_once '../model/works.php';
require_once '../model/pagination.php';
$paginations=new pagination();
$keyword = new Works();
$keyword->table_name = "works";
?>
<?php
if (!isset($_GET["page"]))
    $page = 1;
else
    $page = $_GET["page"];
$keywords = $keyword->Page($page);
$total = $keyword->countPage();
//var_dump($total);
//echo $paginations->Page($page, $total,null,"menu1.php");
?><br>
    
                    <div class="bang">
                        <table border="1px">
                            <tr class="mot">                                   
                            <td><b>STT</b></td>
                            <td><b>name</b></td>
                            <td><b>description</b></td>
                            <td><b>posted</b></td>
                        </tr>
                            
                            <?php foreach ($keywords as $item): ?>
                                <tr>
                                <td><?php echo$item['id']; ?></td>
                                <td class="link"><a href="<?php echo substr($item['url'],0,50 );?>">
                                    <?php echo$item['name']; ?></a></td>                                            
                                <td><?php echo substr($item['description'],0,100); ?></td>
                                <td><?php $mydate = getdate($item['posted']); ?> 
                                    <?php echo "$mydate[mday] $mydate[month], $mydate[year]"; ?></td>
                            <?php endforeach; ?>
                        </tr>
                        </table><br>
                        <div class="pagination"><?php  echo $paginations->Page($page, $total,null,"menu1.php");?></div><br><br>
                       
                    </div>
                    
                </div>
<!--                <div class="right">
                    
                </div>-->
            </div>
            <div class="footer">
                <ul>
                    <li><a href="#">Trang chu</a></li>
                    <li><a href="#">Trang chu</a></li>
                    <li><a href="#">Trang chu</a></li>
                    <li><a href="#">Trang chu</a></li>
                    <li><a href="#">Trang chu</a></li>
                    <li><a href="#">Trang chu</a></li>
                </ul>
                <h4>QuyenDo</h4>
            </div>
        </div>
    </body>
</html>